package com.yt.order.service;

import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.BeanUtils;
import javax.annotation.Resource;
import com.yt.order.common.config.YmlConfig;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yt.order.mapper.OrderProductRelationMapper;
import com.yt.order.models.service.IOrderProductRelationService;
import com.yt.order.models.bo.OrderProductRelationSaveBO;
import com.yt.order.models.dto.OrderProductRelationDTO;

/**
 * 订单产品关联关系表控制器
 *
 * @author lvzeming
 * @Date 2025-08-24 23:57:55
 */
@DubboService
public class OrderProductRelationServiceImpl extends ServiceImpl<OrderProductRelationMapper, OrderProductRelationDTO> implements IOrderProductRelationService{

    @Resource
    private YmlConfig ymlConfig;

    @Override
    public boolean add(OrderProductRelationSaveBO saveBO) {
        OrderProductRelationDTO dto = new OrderProductRelationDTO();
        BeanUtils.copyProperties(saveBO,dto);
        Long id = ymlConfig.getPkId();
        dto.setId(id);
        return this.insert(dto);
    }
}
